﻿@model List<NationalIT.split_expenses>
<div id="DriverExpensesSplit" class="boxScroll">
    <table class="table">
        <tr>
            <th>
                <input type="checkbox" name="" value="" class="SplitcheckAll" />
            </th>
            <th>
                ID
            </th>
            <th>
                Owner
            </th>
            <th>
                Expenses
            </th>
            <th>
                Amount
            </th>
            <th>
                Date
            </th>
            <th>
                Fee Charged
            </th>
            <th>
                Current Payroll
            </th>
            <th>
                Paid Off
            </th>
        </tr>
        @foreach (var item in Model)
        {
            <tr>
                <td>
                    <input type="checkbox" name="checkOwner" value="@item.Amount" getID="@item.Id" class="Splitcheckitem"/>
                </td>
                <td>
                    @Html.ActionLink(item.Id.ToString(), "NewOrEdit", "SplitExpenses", new { id = item.Id }, null)
                </td>
                <td>
                    @{
               var driver = NationalIT.DB.Entities.Driver_Info.FirstOrDefault(m => m.ID == item.Idndex);
               if (driver != null)
               {
                        <span>@driver.Last_name @driver.First_name</span>
               }
                    }
                </td>
                <td>
                    @item.Expenses
                </td>
                <td>
                    @String.Format("{0:C}", item.Amount)
                </td>
                <td>
                    @(item.Date.HasValue ? item.Date.Value.ToString("MM/dd/yyyy") : "")
                </td>
                <td>
                    @NationalIT.CommonFunction.getYesNO(item.Fee_Charged)
                </td>
                <td>
                    @NationalIT.CommonFunction.getYesNO(item.Current_Payroll)
                </td>
                <td>
                    @NationalIT.CommonFunction.getYesNO(item.Paid_Off)
                </td>
            </tr>
        }
    </table>
</div>
